import React from 'react'
import './index.css'
import { ScanOutlined, LeftOutlined } from '@ant-design/icons';


type propType = {
  tittle?: string
}

const Tittle = (pathname: string) => {
  switch (pathname) {
    case '/home':
      return '首页';
    case '/cate':
      return '发现';
    case '/order':
      return '订单';
    case '/mess':
      return '消息';
    case '/my':
      return '个人中心';
    default:
      return ''
  }
}

export default function index(prop: propType) {
  const url = window.location.pathname
  const getTittle = () => {
    console.log(window.location.pathname);

  }
  const goBack = () => {
    window.history.back()
  }
  return (
    <>
      <div className='header'>
        <div className='goBack'>
          <LeftOutlined onClick={() => goBack()} />
        </div>
        <div className='tittle' onClick={() => getTittle()}>{Tittle(url)}</div>
        <div className='search'>
          <ScanOutlined />
        </div>
      </div>
      <div className='whiteBox'></div>
    </>
  )
}
